import os
import getpass

from pyexpat.errors import messages

os.environ["LANGCHAIN_TRACING_V2"] = "true"
os.environ["LANGCHAIN_API_KEY"] = getpass.getpass()

os.environ["OPENAI_API_KEY"] = getpass.getpass()

from langchain_openai import ChatOpenAI
def main():
    model = ChatOpenAI(model="gpt-4o-mini")

    from langchain_core.messages import HumanMessage, SystemMessage

    messages = [
        SystemMessage(content="You are a helpful assistant that translates English to French."),
        HumanMessage(content="I love programming.")
    ]

    print(model.invoke(messages))

if __name__ == "__main__":
    main()
